#include <iostream>
using namespace std;

struct Node {
    int data;
    Node* next;
    Node(int x): data(x), next(nullptr) {}
};

Node* swap_pair(Node* head) {
    if (!head || !head->next) {
        return head;
    }

    Node* newHead = head->next;
    head->next = swap_pair(newHead->next);
    newHead->next = head;

    return newHead;
}